package com.liush.system.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.liush.common.result.Result;
import com.liush.model.controller.SysLoginLog;
import com.liush.model.vo.SysLoginLogQueryVo;
import com.liush.system.service.SysLoginLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 系统访问记录 前端控制器
 * </p>
 *
 * @author liush
 * @since 2023-02-25
 */
@Api(tags = "登录日志控制器")
@RestController
@RequestMapping("/admin/system/sysLoginLog")
public class SysLoginLogController {

    @Autowired
    private SysLoginLogService sysLoginLogService;

    @ApiOperation("分页查询")
    @GetMapping("/{pageNum}/{pageSize}")
    public Result index(
            @ApiParam(value = "pageNum", name = "当前页码") @PathVariable Long pageNum,
            @ApiParam(value = "pageSize", name = "每页记录数") @PathVariable Long pageSize,
            @ApiParam(name = "sysLoginLogQueryVo", value = "查询对象") SysLoginLogQueryVo sysLoginLogQueryVo) {
        Page<SysLoginLog> page = new Page<>(pageNum, pageSize);
        Page sysLoginLogPage = sysLoginLogService.findPage(page, sysLoginLogQueryVo);
        return Result.ok(sysLoginLogPage);
    }
}
